﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Security.Principal;
using WarOfDev.Core.StateManagentHelpers;
using WarOfDev.EF;

namespace WarOfDev.Web.Controllers
{
    public class BaseController : Controller
    {
        private Developer currentUser;

        public Developer CurrentUser
        {
            get { return currentUser; }
        }

        private User userToken;

        public User UserToken
        {
            get { return userToken; }
        }

        public BaseController()
            : base()
        {
            HttpContextWrapper contextWrapper = new HttpContextWrapper(System.Web.HttpContext.Current);
            HttpContextBase context = contextWrapper as HttpContextBase;
            this.currentUser = SessionHelper<Developer>.GetCurrentUser(context);
            this.userToken = SecurityTokenHelper<User>.GetSecurityToken(context);
        }
    }
}
